1. Field of the Invention
The present invention relates to an average calculating circuit which calculates and outputs the average of an input signal, in particular to a moving average filter for calculating the moving average of the input signal.
2. Description of Related Art
The moving averaging method is a method for smoothing a signal (For example, Reference I: "Beginner's Digital Filter" Nov. 30, 1989 pp. 9-15 by Shougo Nakamura, Tokyo Denki University Press). According to this moving averaging method, the moving average is calculated as follows. When the k-th moving average is available and the (k+1)-th moving average needs to be calculated, the difference between the oldest data of all the data used in obtaining the k-th moving average and the new data that is input to obtain the (k+1)-th moving average is added to the k-th moving average to obtain the (k+1)-th moving average (p14 in Reference I). The advantage of this method is that the amount of computation in obtaining the moving average is reduced. However, since the difference between the oldest data and the new data is added to the moving average already obtained to obtain the next moving average, once a calculation error occurs by a noise or an operation error, the calculation error propagates indefinitely, which is a problem.
Moreover, occasionally in the prior art, moving averages are first obtained in multiple stages and the moving average of the multiple moving averages is taken. When the number of stages of the moving averages is large, the amount of hardware has to be increased to a great extent in accordance with the number of the moving averages, which is another problem.